package day015.homework.p5;

import day015.map.HashMapTest;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
        HashMap<Integer, String> hm = new HashMap();
        hm.put(1, "张三");
        hm.put(2, "李四");
        hm.put(3, "王五");
        System.out.println(hm.size());
        Set<Integer> set = hm.keySet();
        for (Integer i : set) {
            System.out.print(i + "\t" + hm.get(i) + "\t");
        }
        System.out.println();

        Set<Map.Entry<Integer, String>> entrySet = hm.entrySet();
        for (Map.Entry<Integer, String> entry : entrySet) {
            System.out.print(entry.getKey() + "\t" + entry.getValue() + "\t");
        }
        System.out.println();

        System.out.println(hm.get(1));
        System.out.println(hm.get(10));
        System.out.println(hm.containsKey(10));
        hm.remove(1);
        System.out.println(hm);
    }
}
